package com.itheima.reggie.service;

import com.itheima.reggie.entity.AddressBook;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface AddressBookService {
    List<AddressBook> addressList(Long userId);

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    void setDefaultAddress(AddressBook address);

    void addAddress(AddressBook addressBook);

    AddressBook addressFindOne(Long id);

    void updateAddress(AddressBook addressBook);

    AddressBook getDefaultAddress(Long userId);

    void removeAddress(Long ids);
}
